package com.sm.user.api;

import com.sm.tool.entity.po.User_;
import com.sm.tool.entity.request.PageInfo;
import com.sm.tool.entity.response.ReturnData;
import com.sm.tool.entity.vo.UserDetailListVO;
import com.sm.tool.entity.vo.UserDetailVO;
import com.sm.user.api.service.UserInsideService;
import com.sm.user.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @program: practice
 * @description: 用户登录注册controller
 * @author: liqitian.
 * @create: 2019-11-15 15:13
 **/
@RestController
@RequestMapping("api/v2/oper")
@Slf4j
public class UserInsideApi {

    @Autowired
    private UserInsideService userInsideService;

    /**
     * 检查该管理员是否存在
     *
     * @param adminUserId
     * @return
     */
    @PostMapping("/check_exist_admin")
    public boolean check_exist_admin(
            @RequestParam("adminUserId") Long adminUserId
    ) {
        log.info("adminUserId:{}", adminUserId);
        return userInsideService.check_exist_admin(adminUserId);
    }

    @PostMapping("/get_user_info")
    public User_ getUserInfo(
            @RequestParam("userId") Long userId
    ) {
        return userInsideService.getUserInfo(userId);
    }
}
